﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Forest.Cat.Domain.Entities;
using Forest.Cat.Domain.Shared;
using Forest.Core;

namespace Forest.Cat.Domain.Services.Catalog
{
    public interface IJobService
    {
        void DeleteJob(Job job);

        Job GetJobById(Guid jobId);

        IPagedList<Job> GetAllJobs(int pageIndex, int pageSize);

        void InsertJob(Job job);

        void UpdateJob(Job job);

        IPagedList<Job> GetJobPagedList(int pageIndex, int pageSize, String jobTitle, String companyName, String lovCondition = null);

        /// <summary>
        /// 检索Job一览(前台)
        /// </summary>
        /// <param name="jobTitle"></param>
        /// <param name="companyName"></param>
        /// <param name="lovType"></param>
        /// <param name="lovValue"></param>
        /// <returns></returns>
        IQueryable<Job> FindJobList(String jobTitle, String companyName, String lovCondition = null);

        IPagedList<Job> GetAdvJobPagedList(int pageIndex, int pageSize,
            String keyWord,
            int? industry1,
            int? industry2,
            int? jobCategory1,
            int? jobCategory2,
            String educationLevelString,
            String jobTypeString,
            int? companyType,
            int? postedDate,
            String lovCondition = null);

        IQueryable<Job> AdvSearchJobList(String keyWord,
           int? industry1,
           int? industry2,
           int? jobCategory1,
           int? jobCategory2,
           String educationLevelString,
           String jobTypeString,
           int? companyType,
           int? postedDate,
           String lovCondition = null);

        /// <summary>
        /// 获取职位相关Lov列表
        /// </summary>
        /// <param name="jobTitle"></param>
        /// <param name="companyName"></param>
        /// <param name="lovType"></param>
        /// <returns></returns>
        IList<LovInfoForSearchListView> GetLovInfoList(String jobTitle, String companyName, LovType lovType, String lovCondition);

        /// <summary>
        /// 获取职位相关Lov列表
        /// </summary>
        /// <param name="keyWord"></param>
        /// <param name="industry1"></param>
        /// <param name="industry2"></param>
        /// <param name="jobCategory1"></param>
        /// <param name="jobCategory2"></param>
        /// <param name="educationLevelString"></param>
        /// <param name="jobTypeString"></param>
        /// <param name="companyType"></param>
        /// <param name="postedDate"></param>
        /// <param name="lovType"></param>
        /// <returns></returns>
        IList<LovInfoForSearchListView> GetLovInfoList(String keyWord,
            int? industry1,
            int? industry2,
            int? jobCategory1,
            int? jobCategory2,
            String educationLevelString,
            String jobTypeString,
            int? companyType,
            int? postedDate,
            LovType lovType,
            String lovCondition);

        /// <summary>
        /// 获取公司的职位一览
        /// </summary>
        /// <param name="companyId"></param>
        /// <returns></returns>
        IList<Job> GetJobListByCompanyId(Guid companyId);

        /// <summary>
        /// 获取和传入的职位相同行业的职位列表(排除传入的职位)
        /// </summary>
        /// <param name="jobId"></param>
        /// <returns></returns>
        IList<Job> GetRelatedJobList(Guid jobId);

        /// <summary>
        /// 根据访问记录获取职位信息
        /// </summary>
        /// <param name="jobIdList"></param>
        /// <returns></returns>
        IQueryable<Job> GetJobsRelatedByViewdHistory(IEnumerable<Guid> jobIdList);

        /// <summary>
        /// 获取和求职人相关的职位信息
        /// </summary>
        /// <param name="jobSeekerId"></param>
        /// <returns></returns>
        IQueryable<Job> GetJobsRelatedByJobSeeker(Guid jobSeekerId);
    }
}
